package eleven;

import java.util.ArrayList;
import java.util.Scanner;

public class eleven_sixth {
    public static void main(String[] args) {
        ArrayList<Integer> result=new ArrayList<>();
        int num1=(int)(Math.random()*10);
        int num2=(int)(Math.random()*10);
        Scanner input = new Scanner(System.in);
        System.out.print("What is "+num1+" + "+num2+"? ");
        int ans=input.nextInt();
        while(ans!=num1+num2){
            if(result.contains(ans)){
                System.out.println("You already entered "+ans);
            }
            else{
                System.out.println("Wrong answer!");
                result.add(ans);
            }
            ans=input.nextInt();
        }
        System.out.println("You got it!");

    }
}
